﻿using EntityPWS;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace PartyWorkSupervise.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class PeopleController : ControllerBase
    {
        private readonly ApiDbContext apiDb;
        public PeopleController(ApiDbContext db)
        {
            apiDb = db;
        }

        [HttpGet("GetA")]
        public List<People> GetA()
        {
            return apiDb.peoples.ToList();
        }

        [HttpGet("Get")]
        public Result Get([FromBody] bool Iable_empty)
        {
            Result result = new Result();
            var po=  apiDb.peoples.Where(w => w.Iable_empty == Iable_empty).FirstOrDefault<People>();
            result.Date = po;
            return result;
            
        }
    }
}
